const urlLib = require('url');

const obj1 = urlLib.parse('http://www.baidu.com/index.html?name=lbj&age=1');
console.log(obj1);

const obj2 = urlLib.parse('http://www.baidu.com/index.html?name=lbj&age=1', true);
console.log(obj2);